package com.glls.sbdemo22.exception;

import com.glls.sbdemo22.common.BusinessMsgEnum;

/**
 * @date 2023/5/16
 * @desc 自定义异常
 */
public class BusinessErrorException extends RuntimeException{

    //异常的状态码
    private String code;

    //异常的信息
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public BusinessErrorException() {
    }

    public BusinessErrorException(String message, String code) {
        super(message);
        this.code = code;
    }

    public BusinessErrorException(BusinessMsgEnum msgEnum) {
        this.code = msgEnum.code();
        this.message = msgEnum.msg();
    }


}
